package cn.ijero.contactlist.database.table

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.chad.library.adapter.base.entity.MultiItemEntity

@Entity(tableName = "contact")
data class Contact(
    val avatar: String?,
    @PrimaryKey
    val name: String,
    var pinYin: String = "",
    var shouPin: String = "",
) : MultiItemEntity {
    companion object {
        const val TYPE_HEADER = 0
        const val TYPE_ITEM = 1
    }

    override val itemType: Int
        get() = if (avatar == null) TYPE_HEADER else TYPE_ITEM
}